//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.ruoyi.live.exam.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.ruoyi.live.app.service.CacheService;
import com.ruoyi.live.configuration.SessionInfo;
import com.ruoyi.live.exam.domain.ScoreObjDetail;
import com.ruoyi.live.excel.service.ExamScoreService;
import com.ruoyi.live.base.domain.*;
import com.ruoyi.live.base.mapper.*;
import com.ruoyi.live.register.utils.RegisterContant;
import com.ruoyi.live.standard.service.StandardService;
import com.ruoyi.live.standard.service.StandardServiceFactory;
import com.ruoyi.live.tool.commons.ICommons;
import com.ruoyi.live.tool.commons.IConvert;
import com.ruoyi.live.user.service.ExpertService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;

@Service
public class LiveExamService {
    private static final Logger log = LoggerFactory.getLogger(LiveExamService.class);
    @Autowired
    LiveExamMapper dao;
    @Autowired
    LiveExamJudgeMapper examJudgeMapper;
    @Autowired
    LiveExamClassMapper lecDao;
    @Autowired
    JdbcTemplate jdbcTemplate;
    @Autowired
    LiveExamUserMapper leuDao;
    @Autowired
    UserMapper userDao;
    @Autowired
    LiveTaskUserMapper taskUserDao;
    @Autowired
    LiveScoreStandardMapper standardDao;
    @Autowired
    LiveExamObjectiveScoreMapper objScoreDao;
//    @Autowired
//    AppService appService;
    @Autowired
    LiveExamObjectiveScoreDetailMapper scoreDetailDao;
    @Autowired
    CacheService cacheService;
    @Autowired
    ExpertService expertService;
    @Autowired
    ExamScoreService esService;
    @Autowired
    LiveExamExpertMapper expertDao;
    @Autowired
    LiveServerMapper serverDao;

    public LiveExamService() {
    }

    public void addLiveExam(LiveExam entity, MultipartFile file, HttpServletRequest request) throws Exception {
        try {
            if (file != null) {
                entity.setExamImageUrl(this.savePic(file, request));
            }

            entity.setCreateTime(System.currentTimeMillis());
            entity.setCreateUser(SessionInfo.getUserId());
            entity.setState(1);
            this.dao.insert(entity);
        } catch (Exception var5) {
            var5.printStackTrace();
            log.error("新增LiveExam失败,编号LiveExamService-addLiveExam-1");
            throw new Exception("新增失败,编号LiveExamService-addLiveExam-1");
        }
    }

    public void updateLiveExam(LiveExam entity, MultipartFile file, HttpServletRequest request) throws Exception {
        try {
            if (file != null) {
                entity.setExamImageUrl(this.savePic(file, request));
            }

            this.dao.updateById(entity);
        } catch (Exception var5) {
            var5.printStackTrace();
            log.error("更新LiveExam失败,编号LiveExamService-updateLiveExam-1,id:{}", entity.getId());
            throw new Exception("更新失败,编号LiveExamService-updateLiveExam-1");
        }
    }

    public String savePic(MultipartFile file, HttpServletRequest request) throws Exception {
        String fileName = file.getOriginalFilename();
        if (ICommons.isNullOrEmpty(fileName)) {
            throw new Exception("文件名不能为空");
        } else {
            if (fileName.indexOf("\\") != -1) {
                fileName = fileName.substring(fileName.lastIndexOf("\\"));
            }

            String ext = fileName.substring(fileName.lastIndexOf(".")).toLowerCase();
            if (ICommons.isNullOrEmpty(ext)) {
                throw new Exception("扩展名不能为空");
            } else if (!".jpg.png.bmp.jpeg.gif".contains(ext)) {
                throw new Exception("请上传.jpg.png.bmp.jpeg.gif文件");
            } else {
                String folder = request.getSession().getServletContext().getRealPath("/static/static/data/examCover/");
                String storeName = UUID.randomUUID().toString().replaceAll("-", "") + ext;
                FileOutputStream out = null;

                try {
                    out = new FileOutputStream(folder + storeName);
                    out.write(file.getBytes());
                } catch (Exception var16) {
                    var16.printStackTrace();
                    throw new Exception("上传失败");
                } finally {
                    try {
                        out.flush();
                        out.close();
                    } catch (Exception var15) {
                        var15.printStackTrace();
                    }

                }

                return storeName;
            }
        }
    }

    public LiveExam getLiveExam(Long id) {
        return (LiveExam)this.dao.selectById(id);
    }

    public int deleteLiveExam(Long[] ids) {
        UpdateWrapper updateWrapper = new UpdateWrapper();
        updateWrapper.in("id", ids);
        return this.dao.update(new LiveExam().setState(3), updateWrapper);
    }

    public int deleteLiveExam(String[] ids) throws Exception {
        if (ids.length == 0) {
            throw new Exception("请选择要删除的数据,编号LiveExamService-deleteLiveExam-1");
        } else {
            try {
                int count = 0;

                for(int i = 0; i < ids.length; ++i) {
                    if (!ICommons.isNullOrEmpty(ids[i])) {
                        count += this.dao.updateById((new LiveExam()).setId(IConvert.string2long(ids[i])).setState(3));
                    }
                }

                return count;
            } catch (Exception var4) {
                var4.printStackTrace();
                log.error("删除LiveExam失败,编号LiveExamService-deleteLiveExam-2,ids:{}", ids.toString());
                throw new Exception("删除的数据失败,编号LiveExamService-deleteLiveExam-2");
            }
        }
    }

    public List<LiveExam> query(LiveExam entity) {
        QueryWrapper<LiveExam> wrapper = new QueryWrapper<>();
        wrapper.eq(!ICommons.isNullOrEmpty(entity.getId()), "id", entity.getId())
                .eq(!ICommons.isNullOrEmpty(entity.getState()), "state", entity.getState())
                .eq(!ICommons.isNullOrEmpty(entity.getCreateTime()), "create_time", entity.getCreateTime())
                .eq(!ICommons.isNullOrEmpty(entity.getCreateUser()), "create_user", entity.getCreateUser())
                .like(!ICommons.isNullOrEmpty(entity.getExamName()), "exam_name", entity.getExamName())
                .like(!ICommons.isNullOrEmpty(entity.getExamDesc()), "exam_desc", entity.getExamDesc())
                .eq(!ICommons.isNullOrEmpty(entity.getExamStartTime()), "exam_start_time", entity.getExamStartTime())
                .eq(!ICommons.isNullOrEmpty(entity.getExamDuration()), "exam_duration", entity.getExamDuration())
                .like(!ICommons.isNullOrEmpty(entity.getExamImageUrl()), "exam_image_url", entity.getExamImageUrl())
                .like(!ICommons.isNullOrEmpty(entity.getExamContent()), "exam_content", entity.getExamContent())
                .like(!ICommons.isNullOrEmpty(entity.getExamScorePolicy()), "exam_score_policy", entity.getExamScorePolicy());
        return this.dao.selectList(wrapper);
    }

    public void doBind(String[] ids, Long examId) {
        this.lecDao.delete(new QueryWrapper((new LiveExamClass()).setExamId(examId)));
        int idsLen = ids.length;

        for(int i = 0; i < idsLen; ++i) {
            String id = ids[i];
            this.lecDao.insert((new LiveExamClass()).setClassId(IConvert.string2long(id)).setExamId(examId));
        }

    }

    public LiveExam getExam() {
        List<LiveExam> exams = this.dao.selectList(new QueryWrapper((new LiveExam()).setState(1)));
        return exams.size() > 0 ? (LiveExam)exams.get(0) : null;
    }

    public Map<String, Integer> getDatas(Long id) {
        Map<String, Integer> res = new HashMap();
        Long startCount = this.leuDao.selectCount(new QueryWrapper((new LiveExamUser()).setExamId(id)));
        Long completeCount = this.leuDao.selectCount(new QueryWrapper((new LiveExamUser()).setExamId(id).setState(3)));
        String sql = "select count(1) from user a where a.class_id in (select b.class_id from live_exam_class b where b.exam_id = ?)";
        Integer allCount = (Integer)this.jdbcTemplate.queryForObject(sql, Integer.class, new Object[]{id});
        res.put("all", allCount);
        res.put("start", startCount.intValue());
        res.put("complete", completeCount.intValue());
        return res;
    }

    public List<LiveExamUser> queryUserByExam(LiveExamUser entity) throws Exception {
        if (entity == null) {
            throw new Exception("比赛查询失败");
        } else {
            if (entity.getShowError() == null) {
                entity.setShowError(1);
            }

            if (2 == entity.getShowError()) {
                String sqlIds = "select ifnull(GROUP_CONCAT(exam_user_id),0) ids from live_task_user_channel where channel_type = 2 and (live_video_state = 1 or screen_video_state = 1)";
                List<Map<String, Object>> idsList = this.jdbcTemplate.queryForList(sqlIds);
                String ids = String.valueOf(((Map)idsList.get(0)).get("ids"));
                String[] idsStr = ids.split(",");
                List<Long> idsLong = new ArrayList();
                String[] var7 = idsStr;
                int var8 = idsStr.length;

                for(int var9 = 0; var9 < var8; ++var9) {
                    String idStr = var7[var9];
                    idsLong.add(IConvert.string2long(idStr));
                }

                entity.setIds(idsLong);
            }

            List<LiveExamUser> list = this.userDao.selectExamUsers(entity);
            String sql = "select a.*,(select c.leu_id from live_task_user c where a.task_user_id = c.id) exam_user_id from live_task_user_channel a where a.create_time in (select max(b.create_time) from live_task_user_channel b group by b.task_user_id)";
            List<LiveTaskUserChannel> channels = this.jdbcTemplate.query(sql, new BeanPropertyRowMapper(LiveTaskUserChannel.class));
            Map<Long, LiveTaskUserChannel> res = (Map)channels.stream().collect(Collectors.toMap(LiveTaskUserChannel::getExamUserId, (c) -> {
                return c;
            }));
            sql = "select a.*,(select c.leu_id from live_task_user c where a.task_user_id = c.id) exam_user_id from live_task_user_channel a where a.channel_type = 2";
            List<LiveTaskUserChannel> channelStates = this.jdbcTemplate.query(sql, new BeanPropertyRowMapper(LiveTaskUserChannel.class));
            Iterator var19 = channelStates.iterator();

            while(var19.hasNext()) {
                LiveTaskUserChannel channel = (LiveTaskUserChannel)var19.next();
                res.put(channel.getExamUserId(), channel);
            }

            String taskUserSql = "select id,task_procudt_count,task_procudt_count_used from live_task_user where task_type = 2";
            List<LiveTaskUser> taskUsers = this.jdbcTemplate.query(taskUserSql, new BeanPropertyRowMapper(LiveTaskUser.class));
            Map<Long, LiveTaskUser> taskUserRef = (Map)taskUsers.stream().collect(Collectors.toMap(LiveTaskUser::getId, (tu) -> {
                return tu;
            }));
            Iterator var24 = res.keySet().iterator();

            while(var24.hasNext()) {
                Long key = (Long)var24.next();
                LiveTaskUserChannel channel = (LiveTaskUserChannel)res.get(key);
                LiveTaskUser taskUserCenter = (LiveTaskUser)taskUserRef.get(channel.getTaskUserId());
                channel.setLiveCount(taskUserCenter.getTaskProcudtCount());
                channel.setLiveCountUsed(taskUserCenter.getTaskProcudtCountUsed());
            }

            var24 = list.iterator();

            while(var24.hasNext()) {
                LiveExamUser examUser = (LiveExamUser)var24.next();
                examUser.setChannel((LiveTaskUserChannel)res.get(examUser.getId()));
            }

            return list;
        }
    }

    public void doDelay(String[] ids, Integer count) throws Exception {
        if (ids.length == 0) {
            throw new Exception("请选择数据");
        } else if (count <= 0) {
            throw new Exception("请输入大于0的数");
        } else {
            try {
                for(int i = 0; i < ids.length; ++i) {
                    if (!ICommons.isNullOrEmpty(ids[i])) {
                        Long id = IConvert.string2long(ids[i]);
                        LiveExamUser leu = (LiveExamUser)this.leuDao.selectById(id);
                        this.leuDao.updateById((new LiveExamUser()).setId(id).setState(2).setExamDuration(leu.getExamDuration() + count));
                    }
                }

            } catch (Exception var6) {
                var6.printStackTrace();
                log.error("删除LiveExam失败,编号LiveExamService-deleteLiveExam-2,ids:{}", ids.toString());
                throw new Exception("删除的数据失败,编号LiveExamService-deleteLiveExam-2");
            }
        }
    }

    public void doChangeState(String[] ids) throws Exception {
        if (ids.length == 0) {
            throw new Exception("请选择数据");
        } else {
            try {
                for(int i = 0; i < ids.length; ++i) {
                    if (!ICommons.isNullOrEmpty(ids[i])) {
                        Long id = IConvert.string2long(ids[i]);
                        this.leuDao.updateById((new LiveExamUser()).setId(id).setState(2));
                        List<LiveExamJudge> judges = this.examJudgeMapper.selectList(new QueryWrapper((new LiveExamJudge()).setExamUserId(id)));
                        if (judges.size() > 0) {
                            Iterator var5 = judges.iterator();

                            while(var5.hasNext()) {
                                LiveExamJudge judge = (LiveExamJudge)var5.next();
                                this.examJudgeMapper.updateById((new LiveExamJudge()).setId(judge.getId()).setState(0));
                            }
                        }
                    }
                }

            } catch (Exception var7) {
                var7.printStackTrace();
                log.error("删除LiveExam失败,编号LiveExamService-deleteLiveExam-2,ids:{}", ids.toString());
                throw new Exception("删除的数据失败,编号LiveExamService-deleteLiveExam-2");
            }
        }
    }

    public void doCloseExam(Long id) {
        this.dao.updateById((new LiveExam()).setId(id).setState(2));
    }

    public void doCountAllUser(List<LiveExamUser> examUsers) {
        Iterator var2 = examUsers.iterator();

        while(var2.hasNext()) {
            LiveExamUser eu = (LiveExamUser)var2.next();
            this.doCountObjScore(eu.getId());
        }

    }

//    @RequiresRoles(
//            value = {"teacher", "admin"},
//            logical = Logical.OR
//    )
//    public void doUpdateAllExamUser(Long examId, List<LiveExamUser> examUsers) {
//        Iterator var3 = examUsers.iterator();
//
//        while(var3.hasNext()) {
//            LiveExamUser eu = (LiveExamUser)var3.next();
//            this.appService.doEndExam(eu.getId());
//        }
//
//    }

    public void startExam(Long id) {
        this.dao.updateById((new LiveExam()).setId(id).setState(1));
    }

    public List<LiveExam> listExam() {
        return this.dao.selectList(((QueryWrapper)(new QueryWrapper()).eq("exam_type", 2)).select(new String[]{"id", "exam_name"}));
    }

    public void doCountObjScore(Long examUserId) {
        List<LiveScoreStandard> standards = this.standardDao.selectList((Wrapper)((QueryWrapper)(new QueryWrapper((new LiveScoreStandard()).setStandardType(1))).ne("parent_id", 0)).orderByAsc("orders"));
        LiveExamUser examUser = (LiveExamUser)this.leuDao.selectById(examUserId);
        List<LiveTaskUser> tasks = this.taskUserDao.selectList(new QueryWrapper((new LiveTaskUser()).setLeuId(examUserId)));
        examUser.setTaskUserList(tasks);
        LiveExamObjectiveScore objScore = (LiveExamObjectiveScore)this.objScoreDao.selectOne(new QueryWrapper((new LiveExamObjectiveScore()).setExamUserId(examUserId)));
        String sql;
        if (objScore != null) {
            sql = "delete from live_exam_objective_score_detail where score_id = ?";
            this.jdbcTemplate.update(sql, new Object[]{objScore.getId()});
        } else {
            objScore = (new LiveExamObjectiveScore()).setStudentId(examUser.getCreateUser()).setExamUserId(examUserId).setExamId(examUser.getExamId()).setState(1);
            this.objScoreDao.insert(objScore);
        }

        Iterator var9 = standards.iterator();

        while(var9.hasNext()) {
            LiveScoreStandard standard = (LiveScoreStandard)var9.next();
            if (!ICommons.isNullOrEmpty(standard.getStandardCode())) {
                StandardService serv = StandardServiceFactory.getService(standard.getStandardCode());
                if (serv != null) {
                    serv.doCountScore(examUser, objScore.getId());
                }
            }
        }

        sql = "select count(1) count,sum(state) state,sum(score) score from live_exam_objective_score_detail where score_id = ?";
        List<Map<String, Object>> result = this.jdbcTemplate.queryForList(sql, new Object[]{objScore.getId()});
        if (result.size() > 0) {
            objScore.setScore(new BigDecimal(IConvert.object2double(((Map)result.get(0)).get("score")))).setState(IConvert.object2int(((Map)result.get(0)).get("count")) == IConvert.object2int(((Map)result.get(0)).get("state")) ? 2 : 3);
        } else {
            objScore.setScore(new BigDecimal(0)).setState(3);
        }

        this.objScoreDao.updateById(objScore);
        this.leuDao.updateById((new LiveExamUser()).setId(examUserId).setObjScore(objScore.getScore()));
    }

    public void doCountFinalScore(Long examId) {
        String sql = "update live_exam_user set score=(obj_score+expert_score) where obj_score !='' and expert_score!='' and exam_id = ?";
    }

    public List<LiveExamUser> queryUserExamScore(LiveExamUser entity) throws Exception {
        if (entity == null) {
            throw new Exception("比赛查询失败");
        } else {
            return this.userDao.selectExamUsersObj(entity.getExamId());
        }
    }

    public List<ScoreObjDetail> getScoreDetail(Long id) {
        List<LiveExamObjectiveScoreDetail> list = this.scoreDetailDao.selectList(new QueryWrapper((new LiveExamObjectiveScoreDetail()).setScoreId(id)));
        Map<Long, ScoreObjDetail> res = new HashMap();

        LiveExamObjectiveScoreDetail detail;
        Long productId;
        ScoreObjDetail sod;
        for(Iterator var4 = list.iterator(); var4.hasNext(); sod.getList().add(detail)) {
            detail = (LiveExamObjectiveScoreDetail)var4.next();
            productId = detail.getProductId() == null ? 0L : detail.getProductId();
            sod = (ScoreObjDetail)res.get(productId);
            if (sod == null) {
                String productName = "其他";
                if (!productId.equals(0L)) {
                    productName = this.cacheService.getProductNameById(productId);
                }

                sod = (new ScoreObjDetail()).setProductId(productId).setProductName(productName);
                res.put(productId, sod);
            }
        }

        List<ScoreObjDetail> details = new ArrayList();
        Iterator var10 = res.keySet().iterator();

        while(var10.hasNext()) {
            productId = (Long)var10.next();
            details.add(res.get(productId));
        }

        return details;
    }

    public void reCountAllUser(Long id) {
        List<LiveExamUser> examUsers = this.leuDao.selectList(new QueryWrapper((new LiveExamUser()).setExamId(id)));
        Iterator var3 = examUsers.iterator();

        while(var3.hasNext()) {
            LiveExamUser eu = (LiveExamUser)var3.next();
            this.doCountObjScore(eu.getId());
        }

        this.reCountScore(id);
    }

    public void reCountExpert(Long id) {
        List<LiveExamUser> examUsers = this.leuDao.selectList(new QueryWrapper((new LiveExamUser()).setExamId(id)));
        Iterator var3 = examUsers.iterator();

        while(var3.hasNext()) {
            LiveExamUser eu = (LiveExamUser)var3.next();
            this.expertService.doFinalScore(eu.getId());
        }

    }

    public void reCountScore(Long id) {
        List<LiveExamUser> examUsers = this.leuDao.selectList(new QueryWrapper((new LiveExamUser()).setExamId(id)));
        Iterator var3 = examUsers.iterator();

        while(var3.hasNext()) {
            LiveExamUser eu = (LiveExamUser)var3.next();
            if (!ICommons.isNullOrEmpty(eu.getObjScore()) && !ICommons.isNullOrEmpty(eu.getExpertScore())) {
                this.leuDao.updateById((new LiveExamUser()).setId(eu.getId()).setScore(new BigDecimal(eu.getObjScore().doubleValue() + eu.getExpertScore().doubleValue())));
            }
        }

    }

    public void excelScore(Long id, HttpServletResponse response) throws IOException {
        BigDecimal fullScore = new BigDecimal("3.5");
        if (!"DS50102".equalsIgnoreCase(RegisterContant.versionID)) {
            if ("DS50105".equalsIgnoreCase(RegisterContant.versionID)) {
                fullScore = new BigDecimal("2.2");
            } else if ("DS50103".equalsIgnoreCase(RegisterContant.versionID)) {
                fullScore = new BigDecimal("13");
            } else if ("DS50104".equalsIgnoreCase(RegisterContant.versionID)) {
                fullScore = new BigDecimal("10");
            }
        }

        List<LiveExamObjectiveScore> objScores = this.objScoreDao.selectList((Wrapper)(new QueryWrapper(new LiveExamObjectiveScore())).gt("score", fullScore));
        Iterator var5 = objScores.iterator();

        while(var5.hasNext()) {
            LiveExamObjectiveScore objScore = (LiveExamObjectiveScore)var5.next();
            this.doCountObjScore(objScore.getExamUserId());
        }

        if (objScores.size() > 0) {
            this.reCountScore(id);
        }

        List<LiveExamUser> eus = this.userDao.selectExamUsersObj(id);
        new ArrayList();
        List<User> experts = this.userDao.selectList((Wrapper)(new QueryWrapper((new User()).setUserType(4))).orderByAsc("id"));
        List<LiveExamExpert> examExpert = this.expertDao.selectList(new QueryWrapper((Object)null));
        Map<String, Object> scoreMap = new HashMap();
        Iterator var10 = examExpert.iterator();

        while(var10.hasNext()) {
            LiveExamExpert lee = (LiveExamExpert)var10.next();
            scoreMap.put(lee.getCreateUser() + "-" + lee.getStudentId(), lee.getScore());
        }

        List<List<Object>> datas = new ArrayList();
        List<List<String>> titles = new ArrayList();
        List<String> heads = new ArrayList();
        heads.add("用户名");
        titles.add(heads);
        heads = new ArrayList();
        heads.add("客观得分");
        titles.add(heads);
        Iterator var13 = experts.iterator();

        while(var13.hasNext()) {
            User user = (User)var13.next();
            heads = new ArrayList();
            heads.add(user.getUserLoginName());
            titles.add(heads);
        }

        heads = new ArrayList();
        heads.add("裁判评分平均分");
        titles.add(heads);
        heads = new ArrayList();
        heads.add("最终得分");
        titles.add(heads);
        var13 = eus.iterator();

        while(var13.hasNext()) {
            LiveExamUser eu = (LiveExamUser)var13.next();
            List<Object> list = new ArrayList();
            list.add(eu.getUserLoginName());
            list.add(eu.getObjScore() == null ? 0.0D : eu.getObjScore().doubleValue());
            Iterator var16 = experts.iterator();

            while(var16.hasNext()) {
                User user = (User)var16.next();
                Object sc = scoreMap.get(user.getId() + "-" + eu.getUserId());
                list.add(sc == null ? 0 : sc);
            }

            list.add(eu.getExpertScore() == null ? 0.0D : eu.getExpertScore().doubleValue());
            list.add(eu.getScore() == null ? 0.0D : eu.getScore().doubleValue());
            datas.add(list);
        }

        this.esService.exportScore(datas, titles, response);
    }

    public ModelAndView getExpertScore(Long id) {
        List<LiveExamExpert> experts = this.expertDao.selectList(new QueryWrapper((new LiveExamExpert()).setExamUserId(id)));
        Iterator var3 = experts.iterator();

        while(var3.hasNext()) {
            LiveExamExpert expert = (LiveExamExpert)var3.next();
            expert.setExpertName(((User)this.userDao.selectById(expert.getCreateUser())).getUserLoginName());
        }

        return (new ModelAndView("/exam/live_exam_score_expert_detail")).addObject("experts", experts);
    }

    public void changeExamState(Long id, Integer state) {
        this.dao.updateById((new LiveExam()).setId(id).setState(state));
    }

    public void editServerIp(String ip) {
        this.serverDao.update((new LiveServer()).setServerIp(ip), (Wrapper)null);
    }
}
